package com.open.demo.flow

import kotlinx.coroutines.cancel
import kotlinx.coroutines.channels.awaitClose
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.callbackFlow

/**
 * 将基于回调的 API 转换为数据流
 * @Author: hailong.qiu hailong.qiu@xgimi.com
 * @Maintainer: hailong.qiu hailong.qiu@xgimi.com
 * @Date: 2021/8/3
 * @Copyright: 2021 www.xgimi.com Inc. All rights reserved.
 */
class FirestoreUserEventsDataSource {

    fun getUserEvents():Flow<List<String>> = callbackFlow {

//        offer()
//        cancel()

        awaitClose {

        }
    }


}